import request from '@/utils/request'

// 查询一级经销商列表
export function listDealer(query) {
  return request({
    url: '/DealerMain/dealer/list',
    method: 'get',
    params: query
  })
}

export function listDealerout(query) {
  return request({
    url: '/DealerMain/dealer/listout',
    method: 'get',
    params: query
  })
}

// 查询一级经销商列表-消费排行
export function listDealerph(query) {
  return request({
    url: '/DealerMain/dealer/listph',
    method: 'get',
    params: query
  })
}

// 查询实际渠道列表
export function listDealersj(query) {
  return request({
    url: '/DealerMain/dealer/listsj',
    method: 'get',
    params: query
  })
}


// 查询渠道全部
export function listDealerAll(query) {
  return request({
    url: '/DealerMain/dealer/listsjall',
    method: 'get',
    params: query
  })
}

// 新增加实际渠道
export function addDealersj(data) {
  return request({
    url: '/DealerMain/dealer/addsj',
    method: 'post',
    data: data
  })
}

// 查询一级经销商详细
export function getDealer(deaId) {
  return request({
    url: '/DealerMain/dealer/' + deaId,
    method: 'get'
  })
}

//  分配用户
export function selectyh(data) {
  return request({
    url: '/DealerMain/dealer/selectyh',
    method: 'get',
    params: data
  })
}
//  分配用户-技术员
export function selectyhjs(data) {
  return request({
    url: '/DealerMain/dealer/selectyhjs',
    method: 'get',
    params: data
  })
}

// 新增一级经销商
export function addDealer(data) {
  return request({
    url: '/DealerMain/dealer',
    method: 'post',
    data: data
  })
}
// 同步经销商
 // 查询一级经销商列表
export function tblistDealer(query) {
  return request({
    url: '/DealerMain/dealer/tblistDealer',
    method: 'get',
    params: query
  })
}

// 修改一级经销商
export function updateDealer(data) {
  return request({
    url: '/DealerMain/dealer',
    method: 'put',
    data: data
  })
}

// 删除一级经销商
export function delDealer(deaId) {
  return request({
    url: '/DealerMain/dealer/' + deaId,
    method: 'delete'
  })
}
// 删除一级经销商
export function delDealersj(deaId) {
  return request({
    url: '/DealerMain/dealer/aa/' + deaId,
    method: 'delete'
  })
}

// 用户状态修改
export function changeDeaUserStatus(userId, status) {
 
}
// 用户状态修改
export function ztDealer(deaId,other1) {
  const data = {
    deaId,
    other1
 
  }
  return request({
    url: '/DealerMain/dealer/ztDealer',
    method: 'put',
    data: data
  })
}